home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / KlingonBGApp.sit / Klingon BG App / Source / main.c < prev    next >
C/C++ Source or Header  |  1997-06-28  |  841b  |  58 lines

  1. // Source code for Klingon Clock.   Copyright (C) 1996-1997
  2. // Charles H. Hemstreet IV
  3. //
  4. // Started at MacHack 1996
  5. // Completed at MacHack 1997
  6. //
  7. // Best thanks to:
  8. // My wife Regie, son Chad and baby
  9. // Other thanks to Elden Wood and Bob Clark
  10. //
  11. // This code is distributed "as-is" and implies no warranty or guarantee.
  12.  
  13.  
  14. #ifndef __MAIN__
  15. #include "main.h"
  16. #endif
  17.  
  18.  
  19. void main(void)
  20. {
  21.     InitApp();
  22.     RunApp();
  23.     QuitApp();
  24. }
  25.  
  26.  
  27. void InitApp(void)
  28. {
  29.     OSErr        initAppErr;
  30.     
  31.     Initialize();
  32.     gestaltChecks();
  33.     
  34.     initAppErr = DoInstallAEHandlers();
  35.     if (initAppErr) 
  36.     {
  37.         SysBeep(1); // Beep once but do not die. Just means we can shut down via AE's later.
  38.     }
  39.  
  40.     initAppErr = doSuccessSound();
  41.     assert(initAppErr == noErr);
  42. }
  43.  
  44.  
  45. void RunApp(void)
  46. {
  47.     while (!gExitNow)
  48.     {
  49.         GrabAndDoEvent();
  50.     }
  51. }
  52.  
  53.  
  54. void QuitApp(void)
  55. {
  56.     DoDeallocateEverything();    
  57. }
  58.